package main.java.game.item.equipableTreasure;

import main.java.game.Player;
import main.java.game.combatant.Hero;

public class EquipableTrinketTreasure extends EquipableTreasure {

	
	public EquipableTrinketTreasure (String name, Integer defenseValue, Integer attackValue, Integer initValue, Integer lpValue, Integer sellingPrice, Integer level){
		super(name, defenseValue, attackValue, initValue, lpValue, sellingPrice, level);
		
	}
	public void equip(Hero hero) {
		
		hero.setInit(hero.getInit()+getInitValue());
		hero.setAttack(hero.getAttack()+getAttackValue());
		hero.setDefense(hero.getDefense()+getDefValue());
		hero.setLifepoints(hero.getLifepoints()+getLpValue());
		
		hero.getEquipedTrinkets().add(this);
		hero.getPlayer().getTreasures().remove(this);

	}

	
	public void unequip(Hero hero) {
		Player p=hero.getPlayer();
		hero.setInit(hero.getInit()-getInitValue());
		hero.setAttack(hero.getAttack()-getAttackValue());
		hero.setDefense(hero.getDefense()-getDefValue());
		hero.setLifepoints(hero.getLifepoints()-getLpValue());
		
		hero.getEquipedTrinkets().remove(this);
		p.getTreasures().add(this);

	}
	

}
